// Author: wsfuyibing <682805@qq.com>
// Date: 2025-06-30

package responses

import (
	"server/app/http/models"
	"server/app/kind"
)

// TicketFreeGoodsResponse
// 赠品记录.
type TicketFreeGoodsResponse struct {
	Id       int64
	Goods    *GoodsResponse  `json:",omitempty"`
	GoodsId  kind.GoodsId    `json:",omitempty"`
	Quantity kind.GoodsStock `json:",omitempty"`
}

// With
// 绑定数据.
func (o *TicketFreeGoodsResponse) With(m *models.TicketFreeGoods) *TicketFreeGoodsResponse {
	o.Id = m.Id
	o.GoodsId = m.GoodsId
	o.Quantity = m.Quantity
	return o
}

// WithGoods
// 绑定商品.
func (o *TicketFreeGoodsResponse) WithGoods(m *models.Goods) *TicketFreeGoodsResponse {
	if m != nil {
		o.Goods = (&GoodsResponse{}).With(m)
	}
	return o
}
